/**
 ******************************************************************************
 * @file app_artmaster.c
 * @author GX (2524913364@qq.com)
 * @brief  绘画app
 *         (1) 有画笔大小、橡皮擦和画笔颜色可以选择。
 *         (2) 画笔绘画时每个点是画圆的形式，橡皮擦擦除时是以正方形的方式擦除。
 * @version 1.0.0 
 * @date 2022-07-12
 * 
 * @copyright Copyright (c) 2022
 * 
 ******************************************************************************
 *----------------------------------------------------------------------------*
 *  Remark         : Description                                              *
 *----------------------------------------------------------------------------*
 *  Change History :                                                          *
 *  <Date>     | <Version> | <Author>       | <Description>                   *
 *----------------------------------------------------------------------------*
 *  2022-07-12 | 1.0.0     | GX             | Create file                     *
 *----------------------------------------------------------------------------*
 *                                                                            *
 ******************************************************************************
 */

/*----------------------------- start of file -------------------------------*/

#ifndef _APP_ARTMASTER_H
#define _APP_ARTMASTER_H


/*-------------------------------- include ----------------------------------*/

#include <stdio.h>
#include <stdbool.h>


/*---------------------- Define parameters and types ------------------------*/

typedef enum
{
  ART_KEY_NONE,   /* 无选择 */
  ART_KEY_MINI,   /* 迷你笔 */
  ART_KEY_S,      /* 小号笔 */
  ART_KEY_M,      /* 中号笔 */
  ART_KEY_L,      /* 大号笔 */
  ART_KEY_RED,    /* 红色 */
  ART_KEY_GREEN,  /* 绿色 */
  ART_KEY_BLUE,   /* 蓝色 */
  ART_KEY_BLACK,  /* 黑色 */
  ART_KEY_ERASER, /* 橡皮擦 */
  ART_KEY_BACK    /* 返回 */
}ART_KEY;

#define ART_BOARD_PATH          "./data/artmaster/artmaster.bmp"  /* 画板图图片路径 */

/* 画笔大小（圆的半径）---------------------------- */
#define ART_BRUSH_MINI_SIZE     12
#define ART_BRUSH_S_SIZE        18
#define ART_BRUSH_M_SIZE        24
#define ART_BRUSH_L_SIZE        30

/* 色盘颜色 ------------------------------------- */
#define ART_COLOR_RED           0x00FF0000
#define ART_COLOR_GREEN         0x0000FF00
#define ART_COLOR_BLUE          0x000000FF
#define ART_COLOR_BLACK         0x00000000
#define ART_COLOR_ERASER        0x00FFFFFF  /* 橡皮擦白色 */

/* 色盘尺寸 ------------------------------------- */
#define ART_COLOR_WIDTH         80
#define ART_COLOR_HEIGH         80

/* 按键坐标范围 --------------------------------- */
/* 迷你笔 */
#define ART_BMINI_X_START       0
#define ART_BMINI_X_END         80
#define ART_BMINI_Y_START       0
#define ART_BMINI_Y_END         80
#define ART_BMINI_X_CENTER      40
#define ART_BMINI_Y_CENTER      40

/* 小号笔 */
#define ART_S_X_START           80
#define ART_S_X_END             160
#define ART_S_Y_START           0
#define ART_S_Y_END             80
#define ART_S_X_CENTER          120
#define ART_S_Y_CENTER          40

/* 中号笔 */
#define ART_M_X_START           160
#define ART_M_X_END             240
#define ART_M_Y_START           0
#define ART_M_Y_END             80
#define ART_M_X_CENTER          200
#define ART_M_Y_CENTER          40

/* 大号笔 */
#define ART_L_X_START           240
#define ART_L_X_END             320
#define ART_L_Y_START           0
#define ART_L_Y_END             80
#define ART_L_X_CENTER          280
#define ART_L_Y_CENTER          40

/* 色盘——红 */
#define ART_RED_X_START         320
#define ART_RED_X_END           400
#define ART_RED_Y_START         0
#define ART_RED_Y_END           80

/* 色盘——绿 */
#define ART_GREEN_X_START       400
#define ART_GREEN_X_END         480
#define ART_GREEN_Y_START       0
#define ART_GREEN_Y_END         80

/* 色盘——蓝 */
#define ART_BLUE_X_START        480
#define ART_BLUE_X_END          560
#define ART_BLUE_Y_START        0
#define ART_BLUE_Y_END          80

/* 色盘——黑 */
#define ART_BLACK_X_START       560
#define ART_BLACK_X_END         640
#define ART_BLACK_Y_START       0
#define ART_BLACK_Y_END         80

/* 橡皮 */
#define ART_ERASER_X_START      640
#define ART_ERASER_X_END        720
#define ART_ERASER_Y_START      0
#define ART_ERASER_Y_END        80

/* 退出 */
#define ART_BACK_X_START        720
#define ART_BACK_X_END          800
#define ART_BACK_Y_START        0
#define ART_BACK_Y_END          80

/* 画板 */
#define ART_BOARD_X_START        0
#define ART_BOARD_X_END          800
#define ART_BOARD_Y_START        80
#define ART_BOARD_Y_END          480


/*-------------------------- Function declaration ---------------------------*/

bool app_DrawingBoard(void);


#endif /* _APP_ARTMASTER_H */ 
/*------------------------------ end of file --------------------------------*/

